<template>
    <view>
        <view class="table-box">
            <scroll-view scroll-x="true" class="scroll-view">
                <view class="tr table-tt">
                    <view class="td">时间</view>
                    <view class="td">下发数据</view>
                    <view class="td">寄存器名称</view>
                    <view class="td">执行内容</view>
                    <view class="td">下发状态</view>
                    <view class="td">下发人员</view>
                </view>

                <view class="tr" v-for="(item, index) in table" :key="index">
                    <view class="td">{{ item.send_time}}</view>
                    <view class="td">{{item.send_value}}</view>
                    <view class="td">{{ item.register_name}}</view>
                    <view class="td">{{item.instructions}}</view>
                    <view class="td">{{item.send_status_name}}</view>
                    <view class="td">{{item.operator_name}}</view>
                </view>
            </scroll-view>
        </view>
    </view>
</template>

<script>
import {
    request
} from "../../../comon/js/request.js"
export default {
    onLoad(option) {
        this.id = option.id
        console.log(option.id, "传过来的id");
        this.getMsg()
    },

    data() {
        return {
            id: "",
            table: [{
                name: '',
                time: '',
                user: '',
                con: '',
                res: ''
            }]
        };
    },
    methods: {
        getMsg() {
            request({
                url: `v1/registerSendRecord/list`,
                data: {
                    register_id: this.id,
                },
                method: "GET"
            }).then(res => {
                console.log(res, '看看返回结构')
                this.table = res.data.result.list.data
            })
        }
    }
};
</script>

<style lang="scss">
.scroll-view {
    white-space: nowrap;
    width: 100%;
}

.table-box {
    .tt {
        background: $color-theme-blue;
    }

    .tr {
        box-sizing: border-box;
        padding: 0;
    }

    .td {
        background: inherit;
        display: inline-block;
        width: 37%;
        padding: 25rpx 0;
        box-sizing: border-box;
    }
}
</style>
